const global = require('global');

cc.Class({
    extends: cc.Component,

    properties: {
		gklabel:cc.Label,
		gkbtn:cc.Button,
		_gkid:0,
    },

    onLoad () {
		cc.director.once('qkcell',(e)=>{
			this._gkid = e.detail;
			this.gklabel.string = e.detail;
			if(this._gkid <= global.gkjindu){
				this.gkbtn.node.color = new cc.color(255,255,255);
				
			}
			//cc.log('gkcell======e.detail='+e.detail+',global.gkjindu='+global.gkjindu);
		},this);
    },

    onBtnClick() {
		if(this._gkid <= global.gkjindu){
			cc.director.emit('qkclick',this._gkid);
		}
		//cc.log('gkcell=======this._gkid'+this._gkid);
	},

    // update (dt) {},
});
